<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      >
      
    <f:loadBundle basename="com.ressources.message" var="msg"/>
    <f:loadBundle basename="com.ressources.menu" var="menu"/>
    
    <h:body>
   
	<ui:composition template="../temp.xhtml">
	
		
	    <ui:define name="title">
	     	<h:outputText value="#{msg['pressionPartielleProfMax.titre']}" />
	    </ui:define>
	
	 	<ui:define name="titleArticle">	      
	      	<h:outputText value="#{msg['pressionPartielleProfMax.titreArticle']}" />
	    </ui:define>
	
	    <ui:define name="content">
	    
	    	<p:breadCrumb>  
			    <p:menuitem value="Categories" url="#" />  
			    <p:menuitem value="Sports" url="#" />  
			</p:breadCrumb> 
	    
	    	<p:messages id="messages" autoUpdate="true" closable="true" />  
	    	    
	    	   
	    	<h:panelGroup rendered="#{profondeurMaximale.viewTrue}">
			    
			     <div class="ui-messages-info ui-corner-al">
			    	<span class="ui-messages-info-icon"> </span>
			    	<span class="ui-messages-info-summary">
			    			<h:outputText value="#{msg['validation.correct']}" />    
			    	</span>					    	
			    </div>
			    
			</h:panelGroup>
			
			<h:panelGroup 
				columns="1" border="1" rules="all"
				rendered="#{profondeurMaximale.viewFalse}">
				
				
			    <div class="ui-messages-warn ui-corner-al">
			    	<span class="ui-messages-warn-icon"> </span>
			    	<span class="ui-messages-warn-summary">
			    			<h:outputText value="#{msg['validation.incorrect']}" />   	
			    		     <p:commandButton id="effectsDialogButton" 
			    												icon="ui-icon-comment"			    												
			    												onclick="dlg3.show();" 
			    												type="button" />  
			    	</span>					    	
			    </div>
			    
			    <p:dialog header="#{msg['titre.correction']}" 
			    				modal="true" 	    				
			    				widgetVar="dlg3" 
			    				showEffect="explode" 
			    				hideEffect="explode" 
			    				resizable="false"
			    				
			    				>  
					    <h:outputText value="#{profondeurMaximale.correctionTexte}" escape="false" />  
				</p:dialog> 
			
				
			</h:panelGroup>
			 
    		<p></p>
	    	<p>
	    		<h:outputText value="#{msg['profondeurMax.enonce1']}" />
	    		<h:outputText value="#{profondeurMaximale.pp.pourcentageOxy}" />
	    		<h:outputText value="#{msg['profondeurMax.enonce2']}" />
	    		<h:outputText value="#{profondeurMaximale.pp.ppo2max}" />
	    		<h:outputText value="#{msg['profondeurMax.enonce3']}" />
	    		<h:outputText value="#{profondeurMaximale.pp.ppo2fede}" />
	    		<h:outputText value="#{msg['profondeurMax.enonce4']}" />		
	    	</p>
			<p>
				<h:outputText value="#{msg['profondeurMax.question']}" />				
			<br/>
				<h:outputText 
					value="#{profondeurMaximale.resultat}"
					rendered="#{affichageReponse.debug}" >
					<f:convertNumber pattern="#0.0" />
				</h:outputText>
			
			</p>
			<p>
				<h:form id="exercice">
					<table>
						<tr>
							<td>
								<h:outputLabel for="answer" value="#{msg['texte.soumission']}" />  
							</td>
							<td>
								<p:inputText						    		
					    			value="#{profondeurMaximale.reponseCandidat}" 
					    			rendered="#{profondeurMaximale.inputReponse}" 
					    			id="answer"
					    			required="true"
					    			maxlengh="5"
									label="Reponse" 
									title="Arrondir a un chiffre apres la virgule"
									validatorMessage="#{msg['formulaire.taille']}"
    								converterMessage="#{msg['formulaire.type']}">
								    <f:validateLength minimum="1" maximum="5"></f:validateLength>
								    <f:validator validatorId="com.validator.NumberValidator" />
								</p:inputText>
								<p:tooltip for="answer" showEvent="focus" hideEvent="blur" showEffect="slide" hideEffect="slide" />  
								
								<b>								
									<h:outputText 		
										value="#{profondeurMaximale.reponseCandidat}"
										rendered="#{profondeurMaximale.texteReponse}" />										
									<h:outputText 		
										value="#{msg['unite.metre']} "
										rendered="#{profondeurMaximale.texteReponse}"
										escape="false" />	
								</b>  	
							</td>								
						</tr>
						<tr>
							<td></td>
							<td>
								 <h:commandButton type="submit"
				        				value="#{msg['bouton.soumission']}" 
				        				actionListener="#{profondeurMaximale.corriger}"
				        				rendered="#{profondeurMaximale.boutonValidation}"/> 				        		
				        	</td>					        								
						</tr>	
						<tr>
							<td></td>
							<td>
						    		<h:commandButton type="submit"
						    		style="width:30; #{profondeurMaximale.texteReponse ? '' : ' display: none;'}"
			        				value="#{msg['bouton.newexo']}" 
			        				action="#{profondeurMaximale.newExerice}"				        				
			        				immediate="true"    				        						        				
			        				/> 	
									 				        		
				        	</td>					        								
						</tr>	
						
						
															
					</table>			
				</h:form>		
				
			</p>
	    </ui:define>
	</ui:composition>


    </h:body>
 
</html>